import {ProColumnType} from "@ant-design/pro-components";
import {Tag} from "antd";
export type DataType = {
    userName: string;
    createTime:string
    key: string;
    id:number;
    userAvatar:string;
    userProfile:string;
    userRole:string;
  accessKey:string;
  secretKey:string;
};

export const userColumns: ProColumnType<DataType>[] = [
   {
       dataIndex: 'id',
       valueType: 'index',
       hideInTable: true,
       key: 'id',
    },
    {
        title: '昵称',
        dataIndex: 'userName',
        valueType: 'text',
        key: 'userName',
    },
    {
        title: '头像',
        dataIndex: 'userAvatar',
        valueType: 'image',
        key: 'avatarUrl',
        search: false,
    },
   {
    title: '信息描述',
    dataIndex: 'userProfile',
    valueType: 'text',
    key: 'userProfile',
   },
  {
    title: '用户权限',
    dataIndex: 'userRole',
    valueType: 'text',
    filters: true,
    onFilter: true,
    key: 'userRole',

    valueEnum: {
      user: {
        text: <Tag color="processing">用户</Tag>,
      },
      admin: {
        text: <Tag color="processing">管理员</Tag>,
      },
    },
  },
  {
    title: '注册时间',
    dataIndex: 'createTime',
    valueType: 'dateTime',
    key: 'createTime',
    search: false,
  },
  {
    title: 'accessKey',
    dataIndex: 'accessKey',
    valueType: 'text',
    key: 'accessKey',
    search: false,
  },
  {
    title: 'secretKey',
    dataIndex: 'secretKey',
    valueType: 'text',
    key: 'secretKey',
    search: false,
  },
];
